<?php
namespace App\Modules\Fund;
use App\Modules\AdapterApi;
use App\Services\Fund\FundIndex;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2018/6/12
 * Time: 10:10
 */
class IntegralDistribute extends AdapterApi
{
     /*添加资金派发积分的记录*/
    public function add(): array 
    {
        $data = pick_array($this->postData,['other_app_read', 'is_public', 'fund_type', 'fund', 'integral', 'remark', 'token']);
        return FundIndex::IntegralDistribute()->add($data);
    }

    public function list(): array 
    {
       $data = pick_array($this->postData,['page', 'listRows', 'token']);
        return FundIndex::IntegralDistribute()->list($data);
    }

    /*后台管理员一键派发积分*/
   /* public function oneKeyDistribute(): array 
    {
        $data = $this->haveIssetReceiveData(['certificate_ids'=>'', 'distribute_time'=>'', 'token'=>' ']);
        return $this->stepRun($data, 'serveruser/auth/Token/hGetAll,serveruser/auth/App/find,servercertificate/certificate/Certificate/getCertiListByIds,serverfund/integral/IntegralDistribute/getOneNew,servercertificate/certificate/Certificate/integralDistribute,serverfund/integral/IntegralAccount/prepaidByUids', '', 'oneKeyDistribute', '1', $this->integralDistributeValidate, $this->integralDistributeLogic);
    }*/

    /*后台管理员获取派发积分分页列表*/
    public function getDistributePageList(): array 
    {
        $data = pick_array($this->postData,['distribute_date', 'keywords', 'status', 'certificate_id', 'page', 'listRows']);
        return FundIndex::IntegralDistribute()->getDistributePageList($data);


       /* $data = $this->haveIssetReceiveData(['distribute_date'=>'', 'keywords'=>'', 'status'=>'','certificate_id'=>'', 'page'=>1, 'listRows'=>15], []);
        return $this->oneStepRun($data, 'servercertificate/certificate/Certificate/getDistributePageList', '', '1', $this->integralDistributeValidate, $this->integralDistributeLogic);*/
    }
}